<template>
  <div class="box">
    我是box
  </div>
</template>

<script>
import { onMounted, onUnmounted, onUpdated} from 'vue'
export default {
  setup() {
    // 以后发请求都在setup里发  没有 created 和 beforeCreate getList()
    console.log('setup', document.querySelector('.box'))
    // 除了调用方式  没有任何区别
    onMounted(() => {
      console.log('onMounted', document.querySelector('.box'))
    })
    onUpdated(() => {
      console.log('onUpdated')
    })
    // destoryed => onUnmounted
    onUnmounted(() => {
      console.log('onUnmounted')
      console.log('释放一些资源,清除定时器')
    })
  }
}
</script>

<style>

</style>
